-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 replace pkg/runtime/log for pkg/log in just the v2 scaffolding. #1326
Conversation
/assign @mengqiy |
@@ -96,7 +96,7 @@ package {{ .Resource.Version }} | |||
|
|||
import ( | |||
ctrl "sigs.k8s.io/controller-runtime" | |||
logf "sigs.k8s.io/controller-runtime/pkg/runtime/log" | |||
logf "sigs.k8s.io/controller-runtime/pkg/log" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mengqiy done 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides pkg/scaffold/v2/webhook/webhook.go
, there are 3 more places need to be change:
- pkg/scaffold/v1/controller/controller.go
- pkg/scaffold/v1/manager/cmd.go
- pkg/scaffold/v1/webhook/server.go
Though they are for v1 project, but the idea is to not generating something using an deprecated package.
Oks, I will do that @mengqiy. I thought that we should not do it for v1. |
It should be very low risk doing that, since (1) the the deprecated package redirect to the new package. (2) Not many users use v1 any more. The point here is mostly that we should not scaffold project using a deprecated package, which causing it doesn't pass staticcheck linter. |
Hi @mengqiy
My comment was because of: Also, see that after this PR be merged any V2 project will NOT be scaffolded with the deprecated lib. So, if the user is using the lint it should pass in the test/check Regards:
I do not think that it will be possible. The V1 is using the vendor and other versions. So, for the version used in V1, the lib is not deprecated and the new implementation is not available.
See that in V2 we are using an upper version: go 1.13
require (
github.com/go-logr/logr v0.1.0
github.com/onsi/ginkgo v1.8.0
github.com/onsi/gomega v1.5.0
k8s.io/apimachinery v0.0.0-20190913080033-27d36303b655
k8s.io/client-go v0.0.0-20190918160344-1fbdaa4c8d90
sigs.k8s.io/controller-runtime v0.4.0
) This changed was made/introduced in the version v0.2.0-alpha.0. See the PR: kubernetes-sigs/controller-runtime#290. Please, let me know if it makes sense and if has anything else that you would like to get done for we close this one. |
You are right! |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: camilamacedo86, mengqiy The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Closes: #1269